<?php

class Negocio_IndexController extends Zend_Controller_Action {

    public function init() {
        $this->_helper->_layout->setLayout('layout_negocios');
        
        $auth = Zend_Auth::getInstance();

        if ($auth->hasIdentity()) {
            if (!empty($auth->getIdentity()->id)) {
                $usuarioDao = new Doctrine_Model_UsuariosDoctrineDao();
                $this->view->usuario = $usuarioDao->obtenerPorId($auth->getIdentity()->id);
            }
        } else {
            $this->_helper->redirector('index', 'login', 'admin');
        }
        
        /* Colores */
        $colores = array(
            '5b92d6' => array('5b92d6', '8fbaef'), //azul
            'd6d65b' => array('d6d65b', 'bfbf3f'), //amarillo
            '51ad56' => array('51ad56', '73be78'), //verde
            'db6f70' => array('db6f70', 'e59899'), //rojo
            '5e71a0' => array('5e71a0', '8e9cbc'), //azul oscuro
            'd68e5b' => array('d68e5b', 'e8a97c'), //naranja
            '92989f' => array('92989f', 'bbbec3')); //gris
        $this->view->colorSucursal = $colores[$this->view->usuario->getSucursal()->getColor()];
        /* Colores */
        
        $this->_session = new Zend_Session_Namespace('tema');

        if ($this->_session->tema) {
            $this->view->logo = 'logoVerde.jpg';
            $this->view->colorFondo = '#4D9473';
            $this->view->colorFuente = '#FFF';
            $this->view->colorFuenteContenido = '#000';
            $this->view->colorContenido = '#C6DC94';
            $this->view->colorMenu = 'navbar-inverse';
            $this->view->colorFondoMenuLateral = '#DFDFDF';
        } else {
            $this->view->logo = 'logoBlanco.jpg';
        }
    }

    public function indexAction() {
        
    }

}

